# Untitled - By: 64386 - Thu Nov 23 2023

import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)

clock = time.clock()
red = (32, 57, 25, 127, 23, 127)
#blue = (xxx,xxx,xxx,xxx,xxx,xxx)
#yellow = (xxx,xxx,xxx,xxx,xxx,xxx)
while(True):
    clock.tick()
    img = sensor.snapshot()
    #print(clock.fps())
    #畸变矫正
    img = sensor.snapshot().lens_corr(strength = 1.5, zoom = 1.0)


    blobs = img.find_blobs([red])
    for blob in blobs:

        img.draw_cross(blob[5],blob[6])   #色块画十字
        img.draw_rectangle(blob.rect())   #框住色块
        print(blob[5], blob[6])
   # color_blobs = img.find_blobs([red,blue, yellow])
